# coding=utf-8
import requests,time



url='http://i.meizitu.net/2014/08/20140808p03.jpg'
path = "c://WORKSPACE//logs//"

headers = {
	'Host': 'www.mzitu.com',
	'Connection': 'keep-alive',
	'Cache-Control': 'max-age=0',
	'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
	#  'X-Requested-With': 'XMLHttpRequest',
	'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36',
	'DNT': '1',
	'Accept-Encoding': 'gzip, deflate',
	'Accept-Language': 'zh-CN,zh;q=0.8,ja;q=0.6',
	'Referer': 'http://www.mzitu.com/101553'
}


headers2={
	'Host': 'i.meizitu.net',
	'Connection': 'keep-alive',
	#'Cache-Control': 'max-age=0',
	'Accept': 'image/webp,image/apng,image/*,*/*;q=0.8',
	#  'X-Requested-With': 'XMLHttpRequest',
	'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36',
	'DNT': '1',
	'Accept-Encoding': 'gzip, deflate',
	'Accept-Language': 'zh-CN,zh;q=0.8,ja;q=0.6',
	'Referer': 'http://www.mzitu.com/27729/13'
}

conn=requests.session()
rsq=conn.get(url,headers=headers2)
print rsq.status_code
#print rsq.content
f=open('D://jpg//'+str(time.time())+".jpg",'wb')
f.write(rsq.content)
f.close()



